<?php
class Cms_View_Helper_Rating
{
    public $view;

    public function rating($value)
    {
    	echo "Rating: ";
    	
		if ($value != '')
		{
			$rat=round($value);

			for ($ii=0; $ii < $rat; $ii++) {
				echo '<img src="/images/star.gif" width="13" height="12" />';
			}
			$jj=5 - $rat;

			for ($j=0; $j < $jj; $j++) {
				echo '<img src="/images/whitestar.gif" width="13" height="12" />';
			}
		} else {
			for ($j=0; $j < 5; $j++)
				echo '<img src="/images/whitestar.gif" width="13" height="12" />';
		}
    }

    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}
?>